package com.stox.services.screener.util;

import java.util.ArrayList;
import java.util.List;

import com.stox.services.screener.model.Scan;


public abstract class ScanRegistry {

	private static final List<Scan<?>> scans = new ArrayList<>(); 
	
	public static void register(Scan<?> scan){
		scans.add(scan);
	}
	
	public static Scan<?> findOne(String id){
		for(Scan<?> scan : scans){
			if(null != scan && scan.getId().trim().equalsIgnoreCase(id.trim())){
				return scan;
			}
		}
		return null;
	}
	
	public static void remove(String id){
		scans.remove(findOne(id));
	}
}
